cmake_minimum_required(VERSION 2.8.0)
project(LoginServer)

set(CMAKE_CXX_STANDARD 11)
set(root_path ${CMAKE_SOURCE_DIR})

add_compile_options(-D_GLIBCXX_USE_CXX11_ABI=1)

INCLUDE_DIRECTORIES(
        include
        net
        application/protoBuffFiles/
        application
        )
link_directories(
        lib
)

add_compile_options(-std=c++11)

add_compile_options(-D_GLIBCXX_USE_CXX11_ABI=1)



add_executable(LoginServer main.cpp net/Channel.cpp net/Channel.h net/Selector.cpp net/Selector.h net/EventLoop.cpp net/EventLoop.h net/TcpConnection.cpp net/TcpConnection.h net/TcpServer.cpp net/TcpServer.h net/Acceptor.cpp net/Acceptor.h net/Buffer.cpp net/Buffer.h net/InetAddress.cpp net/InetAddress.h net/TimerEventQueue.cpp net/TimerEventQueue.h net/Timer.cpp net/Timer.h net/TimeStamp.cpp net/TimeStamp.h net/CallBacks.h
        application/protoBuffFiles/ChooseRole.pb.cc
        application/protoBuffFiles/ChooseRole.pb.h
        application/protoBuffFiles/Login.pb.cc
        application/protoBuffFiles/Login.pb.h
        application/protoBuffFiles/Logout.pb.h
        application/protoBuffFiles/Logout.pb.cc
        application/protoBuffFiles/CreateRole.pb.h
        application/protoBuffFiles/CreateRole.pb.cc
        application/protoBuffFiles/Move.pb.h
        application/protoBuffFiles/Move.pb.cc
        application/GameServer.cpp application/GameServer.h application/Dispatcher.cpp application/Dispatcher.h application/services/LoginService.cpp application/services/LoginService.h application/Service.h application/Context.cpp application/Context.h application/PlayerBin.cpp application/PlayerBin.h application/services/ChooseRoleService.cpp application/services/ChooseRoleService.h application/services/CreateRoleService.cpp application/services/CreateRoleService.h application/services/MoveService.cpp application/services/MoveService.h application/services/LogoutService.cpp application/services/LogoutService.h application/DatabaseConnPool.cpp application/DatabaseConnPool.h)

target_link_libraries(LoginServer
        -pthread
        ${CMAKE_SOURCE_DIR}/lib/libspdlog.a
	    /home/work/login-server/lib/mysql/lib64/libmysqlcppconn.so.9
	    -lprotobuf
	    /usr/local/lib/libprotoc.so.17
        )

